package com.meng.mmlive.api;

import com.meng.mmlive.entity.Adverts;
import com.meng.mmlive.entity.BaseResponseData;
import com.meng.mmlive.entity.HomeMenu;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;

/**
 * Created by Administrator on 2017/5/13.
 */

public class ApiClient extends ApiManager implements ApiService{
    private static ApiClient apiClient;
    private ApiClient() {
    }
    public static ApiClient instance(){
        if(apiClient == null){
            synchronized (ApiClient.class){
                if(apiClient == null){
                    apiClient = new ApiClient();
                }
            }
        }
        return apiClient;
    }
    @Override
    public Observable<BaseResponseData<List<Adverts>>> getAdverts(@Body RequestBody body) {
        return apiService.getAdverts(body);
    }

    @Override
    public Observable<BaseResponseData<List<HomeMenu>>> getMenuList(@Body RequestBody body) {
        return apiService.getMenuList(body);
    }
}
